<template>
  <el-table
    :data="tableData"
    style="width: 100%">
    <el-table-column
      prop="id"
      label="ID"
      width="120">
    </el-table-column>
    <el-table-column
      prop="name"
      label="姓名"
      width="180">
    </el-table-column>
    <el-table-column
      prop="address"
      label="地址"
    width="160">
    </el-table-column>
    <el-table-column
      prop="createTime"
      label="时间"
    width="120">
    </el-table-column>
    <el-table-column
      prop="email"
      label="邮箱"
    width="120">
    </el-table-column>
    <el-table-column
      prop="phone"
      label="电话号码"
    >
    </el-table-column>
  </el-table>
</template>

<script>

export default {
  data () {
    return {

      tableData:[]
    }

  },mounted() {// 页面加载完成会自动调用
      this.$http.post("/user/list",{currentPage:1,pageSize:5}).then(res =>{
        console.log("====================================")
        alert(res.data.totals);
        this.tableData = res.data.data;
      }).catch(res =>{

      })
  }
}
</script>

<!-- Add "scoped" attribute to limit CSS to this component only -->
<style scoped>
  h1{
    background-color: #e6f15a;
  }
</style>
